home *** CD-ROM | disk | FTP | other *** search
- Path: news.clark.net!not-for-mail
- From: gusty@clark.net (Harlan Messinger)
- Newsgroups: comp.lang.c++
- Subject: Re: Pointer to members
- Date: 14 Feb 1996 06:31:33 GMT
- Organization: Clark Internet Services, Inc., Ellicott City, MD USA
- Message-ID: <4frvk5$n@clarknet.clark.net>
- References: <4fqg56$cfl@gina.zfn.uni-bremen.de>
- NNTP-Posting-Host: explorer.clark.net
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
-
- Holger Burde (j03k@alf.zfn.uni-bremen.de) wrote:
- : Hi,
- :
- : I am writing a drawing Application with C++ and the Motif Toolkit.
- : I saw that the 'right' way to use Classmembers as callbackproc's is
- : to declare them static (static members have ordinary Functions Pointers).
- :
- : Is this the only way ?????
- :
- : Is there any way to get normal member fuctions accepted (cast from
- : member function to Functions Pointer without compiler feature ...) ??
- :
-
- A pointer to a non-static member function is like an offset: it only has
- meaning when combined with a class object relative to which the pointer
- points.
-
- The routine that wants to call the callback procedure expects to be able
- to call the procedure directly. It isn't expecting to have to match a
- pointer-to-member up with an appropriate object. It may not even have
- _access_ to an object of the class.
-
- Except for scope, a static member function is pretty much like a
- non-member function. Its address points directly to it rather than being
- an offset from some other point in the class or its offsprung objects.
-